import request from '@/lib/axios'

export const getWorkFlow = (params: any): Promise<any> => {
  return request({
    url: '/admin-api/aigc/workflow/get',
    method: 'get',
    params
  })
}
export const pluginList = (params: any): Promise<any> => {
  return request({
    url: '/admin-api/aigc/plugin/page',
    method: 'get',
    params
  })
}
export const getPluginApi = (params: any): Promise<any> => {
  return request({
    url: `/admin-api/aigc/plugin/api/${params.id}`,
    method: 'get'
  })
}


export const knowledgeList = (params: any): Promise<any> => {
  return request({
    url: '/admin-api/aigc/knowledge-base/page',
    method: 'get',
    params
  })
}

export const knowledgeAPi = (params: any): Promise<any> => {
  return request({
    url: `/admin-api/aigc/knowledge-file/page`,
    method: 'get',
    params
  })
}

export const publishWorkFlow = (data: any): Promise<any> => {
  return request({
    url: `/admin-api/aigc/workflow/deploy?code=${data.code}`,
    method: 'post',
    // data
  })
}


export const startUPWorkFlow = (data: any): Promise<any> => {
  return request({
    url: `/admin-api/aigc/workflow/start`,
    method: 'post',
    data
  })
}

export const updateWorkFlow = (data: any): Promise<any> => {
  return request({
    url: `/admin-api/aigc/workflow/update`,
    method: 'put',
    data
  })
}

export const debugWorkFlow = (data: any): Promise<any> => {
  return request({
    url: `/admin-api/aigc/workflow/debug`,
    method: 'post',
    data
  })
}

